using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Extensions on <see cref="CloudQueueMessage{T}"/>
	/// </summary>
	public static class CloudQueueMessageOfTExtensions
	{
		/// <summary>
		/// Deserialize a <see cref="CloudQueueMessage"/> to an instance of the given type <typeparamref name="T"/>.
		/// </summary>
		/// <typeparam name="T">The type of oject the message is serialized from.</typeparam>
		/// <param name="cloudQueueMessage">The actual message on the queue.</param>
		/// <returns>An instance of type <typeparamref name="T"/></returns>
		public static T Payload<T>(this CloudQueueMessage<T> cloudQueueMessage)
		{
			return CloudQueueMessageExtensions.Payload<T>(cloudQueueMessage);
		}
	}
}